#!/usr/bin/env python
# -*- coding: utf-8 -*-

from stockdata import stockdatamain
from databasetool import dingdinginfo
import time


def stockdatamainruning():
    while True:

        try:
            stockdatamain.stockCreatekallfile()
        except:
            print(r'stickCreatekallfile出现问题，重新开始')
            dingdinginfo.dingdingSendMsg(r'stickCreatekallfile出现问题，重新开始')
            stockdatamain.stockCreatekallfile()
        try:
            stockdatamain.stockCreatedayallfile()
        except:
            print(r' stockCreatedayallfile出现问题，重新开始')
            dingdinginfo.dingdingSendMsg(r' stockCreatedayallfile出现问题，重新开始')
            stockdatamain.stockCreatedayallfile()
        try:
            stockdatamain.stockCreate1minallfile()
        except:
            print(r'stockCreate1minallfile出现问题，重新开始')
            dingdinginfo.dingdingSendMsg(r'stockCreate1minallfile出现问题，重新开始')
            stockdatamain.stockCreate1minallfile()
        try:
            stockdatamain.stockCreate5minallfile()
        except:
            print(r'stockCreate5minallfile出现问题，重新开始')
            dingdinginfo.dingdingSendMsg(print(r'stockCreate5minallfile出现问题，重新开始'))
            stockdatamain.stockCreate5minallfile()

        time.sleep(5184000)


